<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="{{url('admin/match')}}" method="get">
        <input type="hidden" name="_token" value="{{ csrf_token() }}">
        <input type="hidden" name="page" value="{{$matchs->currentPage()}}">
        <input type="hidden" name="orderField" value="{{$request->input('orderField', 'created_at')}}">
        <input type="hidden" name="orderDirection" value="{{$request->input('orderDirection', 'desc')}}">

        <div class="bjui-searchBar">
            <label>状态：</label>
            <select name="confirm" data-toggle="selectpicker" data-width="80">
                <option></option>
                <option value="un_confirm" <?=$request->input('confirm') == 'un_confirm'? 'selected' : ''?>>未确认</option>
                <option value="confirm" <?=$request->input('confirm') == 'confirm'? 'selected' : ''?>>已确认</option>
            </select>&nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>
            &nbsp;
            <a class="btn btn-orange" href="javascript:;" onclick="$(this).navtab('reloadForm', true);"
               data-icon="undo">清空查询</a>
        </div>
    </form>
</div>
<div class="bjui-pageContent">
    <table data-toggle="tablefixed" data-width="100%" data-nowrap="true">
        <thead>
        <tr>
            <th colspan="4" class="center">丢失物品</th>
            <th colspan="4" class="center">捡到物品</th>
            <th width="100" rowspan="2">状态</th>
            <th width="100" rowspan="2">操作人</th>
            <th width="100" rowspan="2">操作</th>
        </tr>
        <tr>
            <th width="40">id</th>
            <th>名称</th>
            <th>丢失时间</th>
            <th>用户</th>
            <th width="40">id</th>
            <th>名称</th>
            <th>捡到时间</th>
            <th>用户</th>
        </tr>
        </thead>
        <tbody>
        @foreach($matchs as $match)
            <tr>
                <td width="40">{{$match->lostItem->id}}</td>
                <td>{{$match->lostItem->name}}</td>
                <td>{{$match->lostItem->findLostTime()}}</td>
                <td>{{$match->lostItem->user->name}}</td>
                <td width="40">{{$match->findItem->id}}</td>
                <td>{{$match->findItem->name}}</td>
                <td>{{$match->findItem->findLostTime()}}</td>
                <td>{{$match->findItem->user->name}}</td>
                <td>@if($match->confirm)已@else待@endif确认</td>
                <td>@if($match->confirmUser){{$match->confirmUser->name}}@endif</td>
                <td>
                    <a href="{{url('/admin/match/info/' . $match->id)}}" class="btn btn-green" data-toggle="dialog"
                       data-id="match" data-title="查看-匹配信息" data-width="900" data-height="600"
                       data-mask="true">详情</a>
                    @if(!$match->confirm)
                        <a href="{{url('/admin/match/delete/' . $match->id)}}" class="btn btn-red" data-toggle="doajax"
                           data-type="get" data-confirm-msg="确定要删除该行信息吗？">删除</a>
                    @endif
                </td>
            </tr>
        @endforeach
        </tbody>
    </table>
</div>
<div class="bjui-pageFooter">
    <div class="pages">
        <span>每页{{config('view')['numPerPage']}}条，共 {{$matchs->total()}} 条</span>
    </div>
    <div class="pagination-box" data-toggle="pagination" data-total="{{$matchs->total()}}"
         data-page-size="{{config('view')['numPerPage']}}"
         data-page-current="{{$matchs->currentPage()}}"></div>
</div>